package bb.lanxing.model.json;

import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import com.alibaba.fastjson.annotation.JSONField;
import com.orm.SugarRecord;
import com.orm.dsl.Ignore;
import com.tencent.open.SocialOperation;
import com.umeng.socialize.net.dplus.CommonNetImpl;

import java.io.Serializable;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONObject;
import org.litepal.crud.LitePalSupport;

import bb.lanxing.model.database.LitePalTableBase;


public class ServerUser extends LitePalTableBase implements Serializable, Parcelable{

    public static final Parcelable.Creator<ServerUser> CREATOR = new Parcelable.Creator<ServerUser>() {

        public ServerUser createFromParcel(Parcel parcel) {
            return new ServerUser(parcel);
        }


        public ServerUser[] newArray(int i) {
            return new ServerUser[i];
        }
    };
    public static final int GENDER_FAMALE = 0;
    public static final int GENDER_MALE = 1;
    public static final int STATE_FOLLOW = 1;
    public static final int STATE_FOLLOW_BOTH = 2;
    public static final int STATE_NONE = -1;
    public static final int STATE_NONE_FOLLOW = 0;
    private static final long serialVersionUID = 1;
    private int age;
    private String city;
    private long clubId;
    private long eventId;
    private int fans;
    private int follows;

    private int gender;
    @JSONField(name = "ulevel")
    private int level;
    @JSONField(name = "license_number_color")
    private String licenseNumberColor;
    @JSONField(name = "license_number_skin")
    private String licenseNumberSkin;
    @JSONField(name = "main_team")
    private String mainTeam;

    private String medalSmall;
    @JSONField(name = "mobile")
    private String mobile;
    @JSONField(name = "month_valid_count")
    private int monthValidCount;
    @JSONField(name = "month_valid_distance")
    private double monthValidDistance;
    @JSONField(name = "month_valid_time")
    private int monthValidTime;

    private String name;
    private String phone;
    @JSONField(name = "avatar")

    private String photoUrl;
    @JSONField(name = "license_number")
    private String plateNum;
    @JSONField(name = "pro_name")
    private String proName;
    private String province;
    private int rank;
    @JSONField(name = "rank_cycle")
    private int rankCycle;
    @JSONField(name = "rank_run")
    private int rankRun;
    @JSONField(name = "rank_walk")
    private int rankWalk;
    private int relation;
    @JSONField(name = "credits")
    private int score;
    private String signature;
    @JSONField(name = "sina_name")
    private String sinaName;

    @JSONField(name = "total_distance")
    private double totalDistance;

    @Ignore
    private String ulevel;
    @JSONField(name = "medal_small")
    @Ignore
    private List<UserAvatarMedal> userAvatarMedals;

    private long userId;
    @JSONField(name = "valid_count")
    private int validCount;
    @JSONField(name = "valid_distance")
    private double validDistance;
    @JSONField(name = "year_valid_distance")
    private double yearValidDistance;

    @Override
    public int describeContents() {
        return 0;
    }

    public ServerUser() {
    }



    public ServerUser(JSONObject jSONObject) {
        JSONArray arrayValue;

    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeLong(this.userId);
        parcel.writeString(this.name);
        parcel.writeInt(this.level);
        parcel.writeTypedList(this.userAvatarMedals);
        parcel.writeString(this.medalSmall);
        parcel.writeString(this.signature);
        parcel.writeDouble(this.monthValidDistance);
        parcel.writeDouble(this.yearValidDistance);
        parcel.writeString(this.photoUrl);
        parcel.writeInt(this.gender);
        parcel.writeDouble(this.totalDistance);
        parcel.writeDouble(this.validDistance);
        parcel.writeInt(this.monthValidCount);
        parcel.writeInt(this.monthValidTime);
        parcel.writeInt(this.score);
        parcel.writeString(this.city);
        parcel.writeString(this.province);
        parcel.writeInt(this.age);
        parcel.writeInt(this.validCount);
        parcel.writeLong(this.clubId);
        parcel.writeLong(this.eventId);
        parcel.writeString(this.phone);
        parcel.writeInt(this.relation);
        parcel.writeString(this.mainTeam);
        parcel.writeInt(this.fans);
        parcel.writeInt(this.follows);
        parcel.writeInt(this.rank);
        parcel.writeInt(this.rankCycle);
        parcel.writeInt(this.rankRun);
        parcel.writeInt(this.rankWalk);
        parcel.writeString(this.sinaName);
        parcel.writeString(this.mobile);
        parcel.writeString(this.ulevel);
        parcel.writeString(this.plateNum);
        parcel.writeString(this.proName);
        parcel.writeString(this.licenseNumberColor);
        parcel.writeString(this.licenseNumberSkin);
    }

    protected ServerUser(Parcel parcel) {
        this.userId = parcel.readLong();
        this.name = parcel.readString();
        this.level = parcel.readInt();
        this.userAvatarMedals = parcel.createTypedArrayList(UserAvatarMedal.CREATOR);
        this.medalSmall = parcel.readString();
        this.signature = parcel.readString();
        this.monthValidDistance = parcel.readDouble();
        this.yearValidDistance = parcel.readDouble();
        this.photoUrl = parcel.readString();
        this.gender = parcel.readInt();
        this.totalDistance = parcel.readDouble();
        this.validDistance = parcel.readDouble();
        this.monthValidCount = parcel.readInt();
        this.monthValidTime = parcel.readInt();
        this.score = parcel.readInt();
        this.city = parcel.readString();
        this.province = parcel.readString();
        this.age = parcel.readInt();
        this.validCount = parcel.readInt();
        this.clubId = parcel.readLong();
        this.eventId = parcel.readLong();
        this.phone = parcel.readString();
        this.relation = parcel.readInt();
        this.mainTeam = parcel.readString();
        this.fans = parcel.readInt();
        this.follows = parcel.readInt();
        this.rank = parcel.readInt();
        this.rankCycle = parcel.readInt();
        this.rankRun = parcel.readInt();
        this.rankWalk = parcel.readInt();
        this.sinaName = parcel.readString();
        this.mobile = parcel.readString();
        this.ulevel = parcel.readString();
        this.plateNum = parcel.readString();
        this.proName = parcel.readString();
        this.licenseNumberColor = parcel.readString();
        this.licenseNumberSkin = parcel.readString();
    }

    public String getLicenseNumberSkin() {
        return this.licenseNumberSkin;
    }

    public void setLicenseNumberSkin(String str) {
        this.licenseNumberSkin = str;
    }

    public String getLicenseNumberColor() {
        return this.licenseNumberColor;
    }

    public void setLicenseNumberColor(String str) {
        this.licenseNumberColor = str;
    }

    public long getEventId() {
        return this.eventId;
    }

    public void setEventId(long j) {
        this.eventId = j;
    }

    public long getClubId() {
        return this.clubId;
    }

    public void setClubId(long j) {
        this.clubId = j;
    }

    public double getYearValidDistance() {
        return this.yearValidDistance;
    }

    public void setYearValidDistance(double d) {
        this.yearValidDistance = d;
    }

    public int getValidCount() {
        return this.validCount;
    }

    public void setValidCount(int i) {
        this.validCount = i;
    }

    public int getAge() {
        return this.age;
    }

    public void setAge(int i) {
        this.age = i;
    }

    public long getUserId() {
        return this.userId;
    }

    public void setUserId(long j) {
        this.userId = j;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String str) {
        this.name = str;
    }

    public String getSignature() {
        return this.signature;
    }

    public void setSignature(String str) {
        this.signature = str;
    }

    public double getMonthValidDistance() {
        return this.monthValidDistance;
    }

    public void setMonthValidDistance(double d) {
        this.monthValidDistance = d;
    }



    public void setPhotoUrl(String str) {
        this.photoUrl = str;
    }

    public int getGender() {
        return this.gender;
    }

    public void setGender(int i) {
        this.gender = i;
    }



    public double getValidDistance() {
        return this.validDistance;
    }

    public void setValidDistance(double d) {
        this.validDistance = d;
    }

    public int getMonthValidCount() {
        return this.monthValidCount;
    }

    public void setMonthValidCount(int i) {
        this.monthValidCount = i;
    }

    public int getMonthValidTime() {
        return this.monthValidTime;
    }

    public void setMonthValidTime(int i) {
        this.monthValidTime = i;
    }

    public int getScore() {
        return this.score;
    }

    public void setScore(int i) {
        this.score = i;
    }

    public String getCity() {
        return this.city;
    }

    public void setCity(String str) {
        this.city = str;
    }

    public String getProvince() {
        return this.province;
    }

    public void setProvince(String str) {
        this.province = str;
    }

    public String getPhone() {
        return this.phone;
    }

    public void setPhone(String str) {
        this.phone = str;
    }

    public int getLevel() {
        return this.level;
    }

    public void setLevel(int i) {
        this.level = i;
    }

    public String getMedalSmall() {
        return this.medalSmall;
    }

    public void setMedalSmall(String str) {
        this.medalSmall = str;
    }

    public List<UserAvatarMedal> getUserAvatarMedals() {
        return this.userAvatarMedals;
    }

    public void setUserAvatarMedals(List<UserAvatarMedal> list) {
        UserAvatarMedal userAvatarMedal;
        this.userAvatarMedals = list;
        if (list != null) {
            String str = "";
            for (int i = 0; i < list.size(); i++) {
                if ((userAvatarMedal = list.get(i)) != null) {

                    str = (i == list.size() - 1) ? str + userAvatarMedal.getUrl() : str + userAvatarMedal.getUrl() + ";";
                }
            }
            setMedalSmall(str);
            return;
        }
        setMedalSmall(null);
    }

    public String getPhotoUrl() {
        return photoUrl;
    }

    public double getTotalDistance() {
        return totalDistance;
    }

    public String getSinaName() {
        return sinaName;
    }

    public String getUlevel() {
        return ulevel;
    }

    public void setSinaName(String sinaName) {
        this.sinaName = sinaName;
    }

    public void setTotalDistance(double totalDistance) {
        this.totalDistance = totalDistance;
    }

    public void setUlevel(String ulevel) {
        this.ulevel = ulevel;
    }

    public int getRelation() {
        return this.relation;
    }

    public void setRelation(int i) {
        this.relation = i;
    }

    public String getMainTeam() {
        return this.mainTeam;
    }

    public void setMainTeam(String str) {
        this.mainTeam = str;
    }



    public int getFans() {
        return this.fans;
    }

    public void setFans(int i) {
        this.fans = i;
    }

    public int getFollows() {
        return this.follows;
    }

    public void setFollows(int i) {
        this.follows = i;
    }

    public int getRank() {
        return this.rank;
    }

    public void setRank(int i) {
        this.rank = i;
    }

    public int getRankCycle() {
        return this.rankCycle;
    }

    public void setRankCycle(int i) {
        this.rankCycle = i;
    }

    public int getRankRun() {
        return this.rankRun;
    }

    public void setRankRun(int i) {
        this.rankRun = i;
    }

    public int getRankWalk() {
        return this.rankWalk;
    }

    public void setRankWalk(int i) {
        this.rankWalk = i;
    }



    public String getMobile() {
        return this.mobile;
    }

    public void setMobile(String str) {
        this.mobile = str;
    }

    public String getPlateNum() {
        return this.plateNum;
    }

    public void setPlateNum(String str) {
        this.plateNum = str;
    }

    public String getProName() {
        return this.proName;
    }

    public void setProName(String str) {
        this.proName = str;
    }




}
